package com.example.vo;

import lombok.Data;

/**
 * 时间段可用性VO
 */
@Data
public class TimeSlotAvailabilityVO {
    
    /**
     * 时间段（小时）
     */
    private Integer hour;
    
    /**
     * 时间段显示文本
     */
    private String timeRange;
    
    /**
     * 最大预约数量
     */
    private Integer maxAppointments;
    
    /**
     * 已预约数量
     */
    private Integer bookedCount;
    
    /**
     * 剩余名额
     */
    private Integer remainingSlots;
    
    /**
     * 是否可预约
     */
    private Boolean available;
    
    /**
     * 无参构造方法
     */
    public TimeSlotAvailabilityVO() {
    }
    
    /**
     * 构造方法
     */
    public TimeSlotAvailabilityVO(Integer hour, Integer maxAppointments, Integer bookedCount) {
        this.hour = hour;
        this.timeRange = hour + ":00-" + (hour + 1) + ":00";
        this.maxAppointments = maxAppointments;
        this.bookedCount = bookedCount != null ? bookedCount : 0;
        this.remainingSlots = maxAppointments - this.bookedCount;
        this.available = this.remainingSlots > 0;
    }
} 